package com.jiyun.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jiyun.pojo.RiderQueue;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-11-25
 */
@Mapper
public interface RiderQueueMMapper extends BaseMapper<RiderQueue> {

    @Select("select * from rider_queue")
    List<RiderQueue> findAll();

    List<RiderQueue> getStatusFind(Integer status,Integer did);

    @Select("select * from rider_queue where order_id=#{orderId}")
    RiderQueue findOne(String orderId);

    @Update("update rider_queue set drivervaluation=#{drivervaluation} where id=#{id}")
    void updateOrder(Integer id, String drivervaluation);

    @Select("select * from rider_queue where did=#{did} ORDER BY queue_time DESC")
    List<RiderQueue> findPhone(Integer did);

    @Select("select * from rider_queue where id=#{id} and did=#{did}")
    RiderQueue findEndOne(Integer id, Integer did);

}
